<template>
  <div class="content-right">
    <div v-for="(item,index) in categoryInfo" :key="index">
      <img :src="item.image">
      <p>{{item.title}}</p>
    </div>
  </div>
</template>
<script>
import {CategoryPic} from "@/network/category";

export  default {
  name:'CategroyNav',
  data(){
    return {
      categoryInfo:[]
    }
  },
  created(){
    this.$bus.$on('onChange',(data)=>{
      CategoryPic(data.maitKey).then((res)=>{
        console.log(res)
        this.categoryInfo=res.data.list
      })
    })
  }
}
</script>
<style>
.content-right{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  padding-top: 44px;
  padding-left: 65px;
  padding-bottom: 50px;
}
.content-right img{
  width: 120px;
  height: 150px;
  object-fit: cover;
}
.content-right p{
  text-align: center;
}
</style>
